package com.ruoyi.system.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.system.domain.HUAWEI.AtLockedItemInfoTi;
import com.ruoyi.system.domain.base.DataIsolationLockMom;
import com.ruoyi.system.mapper.HUAWEI.AtLockedItemInfoTiMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.system.mapper.DataIsolationLockMomMapper;
import com.ruoyi.system.service.IDataIsolationLockService;

import java.util.List;

/**
 * 隔离锁定数据Service业务层处理
 *
 * @author ruoyi
 * @date 2023-03-16
 */
@Service
public class DataIsolationLockServiceImpl extends ServiceImpl<DataIsolationLockMomMapper, DataIsolationLockMom> implements IDataIsolationLockService {

    @Autowired
    private AtLockedItemInfoTiMapper atLockedItemInfoTiMapper;

    @Override
    public List<AtLockedItemInfoTi> listHuawei(AtLockedItemInfoTi atLockedItemInfoTi) {
        QueryWrapper<AtLockedItemInfoTi> lqw = new QueryWrapper<AtLockedItemInfoTi>();

        if (StringUtils.isNotBlank(atLockedItemInfoTi.getBarcode())){
            lqw.eq("bar_code" , atLockedItemInfoTi.getBarcode());
        }
        if (StringUtils.isNotBlank(atLockedItemInfoTi.getPsn())){
            lqw.eq("psn" , atLockedItemInfoTi.getPsn());
        }
        if (StringUtils.isNotBlank(atLockedItemInfoTi.getBar09())){
            lqw.eq("bar09" , atLockedItemInfoTi.getBar09());
        }
        return atLockedItemInfoTiMapper.selectList(lqw);
    }
}
